package com.senjoeson.socialsecure.ui;

import android.Manifest;
import android.content.Intent;
import android.os.Handler;

import com.senjoeson.socialsecure.R;
import com.senjoeson.socialsecure.base.BaseActivity;

/**
 * @author senjoeson
 * @date 2018/9/17 21:04
 */
public class SplashActivitiy extends BaseActivity {

    @Override
    protected int setResId() {
        return R.layout.activity_splash;
    }


    private String[] permissions = new String[]{
            Manifest.permission.ACCESS_NETWORK_STATE,
            Manifest.permission.MODIFY_AUDIO_SETTINGS,
            Manifest.permission.WRITE_EXTERNAL_STORAGE,
            Manifest.permission.READ_PHONE_STATE,
            Manifest.permission.ACCESS_WIFI_STATE,
            Manifest.permission.CHANGE_WIFI_STATE
    };

    private String permissionIndications = "为了更好体验APP，请允许请求的权限！";

    @Override
    protected void initView() {
        requestPermissionsEntrance(permissions, permissionIndications);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void hasPermissionCallNextOperation() {
       goMain();

    }

    public void goMain(){
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(SplashActivitiy.this, MainActivity.class);
                startActivity(intent);
                finish();
            }
        }, 1000L);
    }
}
